package com.kaibes.module.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.kaibes.module.user.pojo.User;

@Component
public class UserUtils {
    
    @Autowired
    private UserService userService;
    
    public String getNickname(Integer userId) {
        return userService.getNicknameById(userId);
    }
    public String getImage(Integer userId) {
        return userService.getImageById(userId);
    }
    public User getNicknameAndImage(Integer userId) {
        return userService.getNicknameAndImageById(userId);
    }
    
    public long count() {
        return userService.count();
    }
    
    public String lastNickname() {
        return userService.getLast("nickname").getNickname();
    }
    
    public User get(Integer userId) {
        return userService.getById(userId);
    }
}
